package com.utils.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;

public class MobileUtils {
    public static boolean isMobile(String mobile) {
        if (StringUtils.isBlank(mobile)) {
            return false;
        }
        String regex = "^((13[0-9])|(14[5,9])|(15[0-3,5-9])|(16[5-6])|(17[0-8])|(18[0-9])|198|199)\\d{8}$";
        Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
        Matcher m = p.matcher(mobile);
        return m.matches();
    }
    public static void main(String[] args) {
        String str = "15488888888";
        boolean flag = isMobile(str);
        System.out.println(flag);
    }
}
